package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmsCustomerMapper;
import com.ruoyi.system.domain.HmsCustomer;
import com.ruoyi.system.service.IHmsCustomerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-16
 */
@Service
public class HmsCustomerServiceImpl implements IHmsCustomerService 
{
    @Autowired
    private HmsCustomerMapper hmsCustomerMapper;

    /**
     * 查询客户
     * 
     * @param cusId 客户主键
     * @return 客户
     */
    @Override
    public HmsCustomer selectHmsCustomerByCusId(Long cusId)
    {
        return hmsCustomerMapper.selectHmsCustomerByCusId(cusId);
    }

    /**
     * 查询客户列表
     * 
     * @param hmsCustomer 客户
     * @return 客户
     */
    @Override
    public List<HmsCustomer> selectHmsCustomerList(HmsCustomer hmsCustomer)
    {
        return hmsCustomerMapper.selectHmsCustomerList(hmsCustomer);
    }

    /**
     * 新增客户
     * 
     * @param hmsCustomer 客户
     * @return 结果
     */
    @Override
    public int insertHmsCustomer(HmsCustomer hmsCustomer)
    {
        return hmsCustomerMapper.insertHmsCustomer(hmsCustomer);
    }

    /**
     * 修改客户
     * 
     * @param hmsCustomer 客户
     * @return 结果
     */
    @Override
    public int updateHmsCustomer(HmsCustomer hmsCustomer)
    {
        return hmsCustomerMapper.updateHmsCustomer(hmsCustomer);
    }

    /**
     * 批量删除客户
     * 
     * @param cusIds 需要删除的客户主键
     * @return 结果
     */
    @Override
    public int deleteHmsCustomerByCusIds(String cusIds)
    {
        return hmsCustomerMapper.deleteHmsCustomerByCusIds(Convert.toStrArray(cusIds));
    }

    /**
     * 删除客户信息
     * 
     * @param cusId 客户主键
     * @return 结果
     */
    @Override
    public int deleteHmsCustomerByCusId(Long cusId)
    {
        return hmsCustomerMapper.deleteHmsCustomerByCusId(cusId);
    }
}
